Use the FS Command
statement to send a message to whichever program is hosting the Flash Player. If you are not familiar with JavaScript or building projectors, you probably have no need to use FS Command
.
FS Command
has two parameters: Command
and Argument
. Enter the string you want to send in the Command box. If the string requires any arguments, enter them in the Arguments box. The Command and Arguments boxes let you use a literal value or an expression.
In a web browser, an FS Command
statement invokes the JavaScript function moviename_DoFSCommand
in the HTML page that embeds the Flash movie, where moviename
is the name of the Flash player as assigned by the NAME
attribute of the EMBED
or OBJECT
tag. If the Flash player is assigned the name theMovie, the JavaScript function invoked is theMovie_DoFSCommand
.
The JavaScript function is passed the parameters Command
and Arguments
, which can be used for any purpose.
For example, to use the FS Command
statement to open a message dialog box from a Flash movie in the HTML page through Javascript:
1 | In the HTML page that embeds the Flash movie, add the following Javascript code: |
function theMovie_DoFSCommand(command, args) { if (command == "messagebox") { alert(args); } } |
|
2 | In the Flash movie, add the FS Command statement whenever you want to open a message dialog box: |
FS Command ("messagebox", "This is a message box invoked from within Flash.") |
|
You can also use expressions for the FS Command statement and arguments, as in the following example: |
|
FS Command ("messagebox", "Hello, " & name & ", welcome to our website!") |
|
You can set up the HTML page to support this by creating your own template and using the Publish and Preview commands. See Flash publish settings. | |
![]() |
In Director, the FS Command
statement can send messages that are interpreted as events by Lingo. You must write the Lingo code to receive the messages from FS Command
and carry out an action in Director.
In Visual Basic, Visual C++, and other programs that can host ActiveX controls, FS Command
sends a VB Event
with two strings that can be handled in the environment's programming language.
The following special FS Command
statements control a movie playing as a projector:
Command | Arguments | Function |
---|---|---|
|
none |
Closes the projector. |
|
True/False |
True sets the player to full-screen mode. False returns the player to normal menu view. |
|
True/False |
False sets the player so that the movie is always drawn at 100% and the image is never scaled. True sets the player back to the default Show All mode. |
|
True/False |
True enables the full set of right-click menu items. False hides the menu bar. |
|
Path to application |
Executes an application from within the projector. |